<?php

/**
 * Implements hook_page_alter()
 */
function jfs_basic_page_alter(&$page) {
  // -- backtop
  if (theme_get_setting('backtop')) {
    drupal_add_js(array('backtop' => l('<span>' . t('Back to Top') . '</span>', '', array('fragment' => 'page', 'html' => TRUE, 'attributes' => array('id' => 'back-top', 'class' => array('back-top'))))), 'setting');
    drupal_add_js(drupal_get_path('theme', 'jfs_basic'). '/js/backtop.js');
    drupal_add_css(drupal_get_path('theme', 'jfs_basic'). '/css/backtop.css');
  }

  // -- floattabs
  if (theme_get_setting('floattabs')) {
    drupal_add_css(drupal_get_path('theme', 'jfs_basic'). '/css/floattabs.css');
  }
}

/**
 * Override or insert variables into the page template.
 */
function jfs_basic_preprocess_page(&$variables, $hook) {
  $page = $variables['page'];
}

/*
 * Override menu path
 */
function jfs_basic_menu_override($path = '', $clear = FALSE) {
  static $set_path;
  $set_path = $path ? $path : $set_path;

  if ($clear) {
    $set_path = FALSE;
  }
  return $set_path ? $set_path : FALSE;
}
